<form id="resourcesForm" method="post">
	<table class="formTable">
		<tr>
			<td class="table_left"><font color="red">*</font>类型：</td>
		    <td colspan="3">
		    <select id="type" name="type"></select>
		    </td>
		</tr>
		<tr>
			<td class="table_left"><font color="red">*</font>资源名称：</td>
			<td>
				<input type="hidden" name="id"/><input type="hidden" id="level" value="1" name="level"/>
				<input name="name" data-options="required:true,width: 200,prompt:'资源名称'" type="text" class="easyui-textbox"/> 
			</td>
			<td class="table_left"><font color="red">*</font>资源路径：</td>
			<td><input name="url" id="url" data-options="width: 200,prompt:'资源url'" type="text" class="easyui-textbox"/></td>
		</tr>
		<tr>
			<td class="table_left">权限编码：</td>
			<td><input name="permCode" id="permCode" class="easyui-textbox" data-options="width: 200,prompt:'权限编码'"/></td>
			<td class="table_left">菜单图标：</td>
			<td>
				<input name="iconCls" data-options="required:true,width: 200,prompt:'菜单图标'" class="easyui-textbox"/> 
			</td>
		</tr>
		<tr>
			<td class="table_left">排序：</td>
			<td><input name="sort" data-options="width: 200,min:1,max:10000,value:100" class="easyui-numberspinner"/></td>
			<td class="table_left">上级菜单：</td>
			<td><select name="parentId" id="parentId"></select></td>
		</tr>
		<tr>
			<td class="table_left">描述：</td>
			<td colspan="3">
				<input class="easyui-textbox" name="remark" data-options="multiline:true,prompt:'描述'" value="" style="width:250px;height:80px">
			</td>
		</tr>
	</table>
</form>
<script type="text/javascript">
JSmile.KEasy.initForm("#resourcesForm","/sys_resources/saveORupdate"); 
$('#type').combobox({
    url:JSmile.baseUrl+'/sys_dictionary/findAll?type=resources.category.',
    valueField:'value',
    textField:'label',
    width:200,
    editable:false,
    required:true
});
$('#parentId').combotree({
	method: 'get',
	editable:false,
	lines:true,
	width:200,
    url: JSmile.baseUrl+'/sys_resources/findAll?level=2',
    loadFilter:function(data,parent){
    	return JSmile.convert(data);
    },
    onSelect:function(record){
    	$('#level').val(record.attributes.level+1);
    }
});
</script>